<html>
<head><meta charset="utf-8"><title>User Stories: Error Handling Pain Points · project-error-handling · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/index.html">project-error-handling</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html">User Stories: Error Handling Pain Points</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210801778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210801778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210801778">(Sep 21 2020 at 21:22)</a>:</h4>
<p>FWIW I have had difficulty with all the third party options. They all seem like Frameworks with a capital F and I'm sure they are all fine but would prefer some official recommendations that the whole community can get behind. The thing that's in the standard library, the usual source of official recommendations, is the Error trait, and this seems to be generally regarded as kind of meh</p>



<a name="210801878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210801878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210801878">(Sep 21 2020 at 21:22)</a>:</h4>
<p><span class="user-mention" data-user-id="271719">@Mario Carneiro</span> can you give examples of libraries that felt like frameworks and how?</p>



<a name="210801943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210801943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210801943">(Sep 21 2020 at 21:23)</a>:</h4>
<p>Well, I'm aware of eyre and snafu and failure and I think some others, and the names are colorful and tell me nothing about which is better for what</p>



<a name="210801962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210801962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210801962">(Sep 21 2020 at 21:23)</a>:</h4>
<blockquote>
<p>The thing that's in the standard library, the usual source of official recommendations, is the Error trait, and this seems to be generally regarded as kind of meh</p>
</blockquote>
<p>Also curious to hear more about this. I know this was the common sentiment prior to stabilizing the <code>source</code> method but recently I've not heard much feedback like this</p>



<a name="210802019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802019">(Sep 21 2020 at 21:24)</a>:</h4>
<p>or if they are all about the same then maybe they should consolidate</p>



<a name="210802057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802057">(Sep 21 2020 at 21:24)</a>:</h4>
<p>eyre is an error reporting library, snafu is an error defining proc macro library with lots of helpers, failure is both and deprecated</p>



<a name="210802170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802170">(Sep 21 2020 at 21:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="271719">Mario Carneiro</span> <a href="#narrow/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points/near/210801943">said</a>:</p>
<blockquote>
<p>Well, I'm aware of eyre and snafu and failure and I think some others, and the names are colorful and tell me nothing about which is better for what</p>
</blockquote>
<p>this doesn't seem to explain how they feel like frameworks</p>



<a name="210802174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802174">(Sep 21 2020 at 21:25)</a>:</h4>
<p>Result and ? are in rust and work fine as long as you don't need big and complicated error hierarchies. That's what I use for most day to day stuff</p>



<a name="210802245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802245">(Sep 21 2020 at 21:26)</a>:</h4>
<p>do you have any projects you feel comfortable sharing? I'm interested in seeing how you're structuring your error types inside of <code>Result</code></p>



<a name="210802280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802280">(Sep 21 2020 at 21:26)</a>:</h4>
<p>I guess I just want the rust book to say "here just do this" and have good defaults that work for general purpose stuff</p>



<a name="210802444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802444">(Sep 21 2020 at 21:28)</a>:</h4>
<p>Let's see: ATM I'm working on a language server for a language of my own, and it interprets user code that can fail and I need to give good error messages there. My low tech solution is not particularly well suited to getting nice user level stack traces</p>



<a name="210802475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802475">(Sep 21 2020 at 21:28)</a>:</h4>
<p>the rust book has to go for the lowest common denominator, so it can't really recommend anything that's not in <code>std</code></p>



<a name="210802562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802562">(Sep 21 2020 at 21:29)</a>:</h4>
<p>Well I think that's part of the issue: from someone coming from another language this seems like it shouldn't be its own thing</p>



<a name="210802587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802587">(Sep 21 2020 at 21:29)</a>:</h4>
<p>what do you mean "shouldn't be its own thing?"</p>



<a name="210802604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802604">(Sep 21 2020 at 21:29)</a>:</h4>
<p>the idea that you would need a whole book to describe how to handle errors seems pretty scary</p>



<a name="210802608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802608">(Sep 21 2020 at 21:29)</a>:</h4>
<p>as in these shouldn't be separate libraries and should be built into the lang / std?</p>



<a name="210802700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802700">(Sep 21 2020 at 21:30)</a>:</h4>
<p>It's fine if it's a separate library as long as there is some consensus in the community that it's the right approach</p>



<a name="210802724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802724">(Sep 21 2020 at 21:30)</a>:</h4>
<p>but having several competing options is cognitive load</p>



<a name="210802812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802812">(Sep 21 2020 at 21:31)</a>:</h4>
<p>to be fair, the options you mentioned are mostly complementary rather than competing</p>



<a name="210802855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802855">(Sep 21 2020 at 21:31)</a>:</h4>
<p>Maybe the Book of Errors would be just the thing then</p>



<a name="210802856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802856">(Sep 21 2020 at 21:31)</a>:</h4>
<p>except for failure, which is deprecated and afaik inspired both eyre and snafu</p>



<a name="210802927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802927">(Sep 21 2020 at 21:32)</a>:</h4>
<p>eyre's source code can be traced back to failure actually</p>



<a name="210802936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802936">(Sep 21 2020 at 21:32)</a>:</h4>
<p>something that goes through building a mid-size program and doing good error reporting in it</p>



<a name="210802951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802951">(Sep 21 2020 at 21:32)</a>:</h4>
<p>eyre is a fork of anyhow which is a split of <code>fehler</code> which started as a rewrite of <code>failure</code></p>



<a name="210802971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210802971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210802971">(Sep 21 2020 at 21:32)</a>:</h4>
<p>ah right I knew I missed a couple</p>



<a name="210803035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803035">(Sep 21 2020 at 21:33)</a>:</h4>
<p>that seems to be a common story, lol</p>



<a name="210803040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803040">(Sep 21 2020 at 21:33)</a>:</h4>
<p>hopefully something we can fix</p>



<a name="210803055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803055">(Sep 21 2020 at 21:33)</a>:</h4>
<p>maybe a chapter on the history and evolution of error handling in rust would be appropriate</p>



<a name="210803086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803086">(Sep 21 2020 at 21:33)</a>:</h4>
<p>especially because from the outside the time axis is absent</p>



<a name="210803092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803092">(Sep 21 2020 at 21:33)</a>:</h4>
<p>yea</p>



<a name="210803154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803154">(Sep 21 2020 at 21:34)</a>:</h4>
<p>It's really valuable to know now that eyre and snafu are the active ones</p>



<a name="210803157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803157">(Sep 21 2020 at 21:34)</a>:</h4>
<p>have you seen <span class="user-mention" data-user-id="211722">@Yoshua Wuyts</span> 's survey of the error handling ecosystem ?</p>



<a name="210803182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803182">(Sep 21 2020 at 21:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="271719">Mario Carneiro</span> <a href="#narrow/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points/near/210803154">said</a>:</p>
<blockquote>
<p>It's really valuable to know now that eyre and snafu are the active ones</p>
</blockquote>
<p>its a little more complicated than this</p>



<a name="210803196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803196">(Sep 21 2020 at 21:34)</a>:</h4>
<p>eyre / anyhow are the most actively used reporting libraries</p>



<a name="210803206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803206">(Sep 21 2020 at 21:34)</a>:</h4>
<p>:P</p>



<a name="210803218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803218">(Sep 21 2020 at 21:34)</a>:</h4>
<p>snafu / thiserror / derive_more / a bunch more libraries exist and are active for defining errors</p>



<a name="210803247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803247">(Sep 21 2020 at 21:35)</a>:</h4>
<p>all of them seek to reduce boilerplate around implementing associated traits and in some cases gathering context</p>



<a name="210803267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803267">(Sep 21 2020 at 21:35)</a>:</h4>
<p>and then there are other error handling libraries that don't really overlap with either of those goals</p>



<a name="210803291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803291">(Sep 21 2020 at 21:35)</a>:</h4>
<p>such as tracing-error which is for instrumenting errors with custom defined stack traces that include runtime information</p>



<a name="210803322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803322">(Sep 21 2020 at 21:36)</a>:</h4>
<p>or <code>fehler</code> which adjusts the syntax of error propagation to be more like exceptions thru a proc macro</p>



<a name="210803416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803416">(Sep 21 2020 at 21:36)</a>:</h4>
<p>ah, now I remember that, <code>fehler</code> is ok-wrapping</p>



<a name="210803419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803419">(Sep 21 2020 at 21:36)</a>:</h4>
<p>and there are color-eyre and color-backtrace for customizing the format of your error reports</p>



<a name="210803458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803458">(Sep 21 2020 at 21:36)</a>:</h4>
<p>are those for console printing?</p>



<a name="210803471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803471">(Sep 21 2020 at 21:37)</a>:</h4>
<p>to a degree</p>



<a name="210803483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803483">(Sep 21 2020 at 21:37)</a>:</h4>
<p>color-backtrace pretty much exclusively</p>



<a name="210803504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803504">(Sep 21 2020 at 21:37)</a>:</h4>
<p>color-eyre right now exclusively as well tho in the future im planning on adding integration with logging</p>



<a name="210803544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803544">(Sep 21 2020 at 21:37)</a>:</h4>
<p>Would you say that the Error trait is sufficient for the sorts of things eyre is doing?</p>



<a name="210803586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803586">(Sep 21 2020 at 21:38)</a>:</h4>
<p>no</p>



<a name="210803597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803597">(Sep 21 2020 at 21:38)</a>:</h4>
<p>and I've already written an RFC to address the issue</p>



<a name="210803634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803634">(Sep 21 2020 at 21:38)</a>:</h4>
<p><a href="https://github.com/yaahc/rfcs/blob/master/text/0000-dyn-error-generic-member-access.md">https://github.com/yaahc/rfcs/blob/master/text/0000-dyn-error-generic-member-access.md</a></p>



<a name="210803669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803669">(Sep 21 2020 at 21:39)</a>:</h4>
<p>tho now its a little out of date because my friend whose been helping me with the object-provider part of the proposed api recently did a bunch of improvements on the design</p>



<a name="210803678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803678">(Sep 21 2020 at 21:39)</a>:</h4>
<p>so I gotta bring those changes into the RFC</p>



<a name="210803829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803829">(Sep 21 2020 at 21:41)</a>:</h4>
<p>My language server has a spot where it collects errors from anywhere and everywhere (including panics) in order to not stop the show. This uses <code>Box&lt;dyn Error + Send + Sync&gt;</code> and the reporting is pretty atrocious</p>



<a name="210803846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803846">(Sep 21 2020 at 21:41)</a>:</h4>
<p>:/</p>



<a name="210803887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803887">(Sep 21 2020 at 21:41)</a>:</h4>
<p>well i can definitely recommend both eyre and anyhow for fixing reporting issues</p>



<a name="210803978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803978">(Sep 21 2020 at 21:42)</a>:</h4>
<p>you can think of their <code>eyre::Report</code>/<code>anyhow::Error</code> types as a fancy <code>Box&lt;dyn Error + Send + Sync + 'static&gt;</code></p>



<a name="210803991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210803991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210803991">(Sep 21 2020 at 21:42)</a>:</h4>
<p>elsewhere I have one error type <code>ElabError</code> so that I can do the classic <code>type Result&lt;T&gt; = Result&lt;T, ElabError&gt;</code>. In principle this should be a big enum but right now it's basically a wrapper around a source location and a dyn Display</p>



<a name="210804015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804015">(Sep 21 2020 at 21:42)</a>:</h4>
<p>aah</p>



<a name="210804046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804046">(Sep 21 2020 at 21:43)</a>:</h4>
<p>so would you say you're almost exclusively reporting errors</p>



<a name="210804056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804056">(Sep 21 2020 at 21:43)</a>:</h4>
<p>and infrequently reacting to specific errors?</p>



<a name="210804111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804111">(Sep 21 2020 at 21:43)</a>:</h4>
<p>Yes, but context and location gathering is important and all hand rolled right now</p>



<a name="210804126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804126">(Sep 21 2020 at 21:43)</a>:</h4>
<p>gotcha</p>



<a name="210804163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804163">(Sep 21 2020 at 21:44)</a>:</h4>
<p>yea this seems like exactly the problem eyre/anyhow try to solve</p>



<a name="210804198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804198">(Sep 21 2020 at 21:44)</a>:</h4>
<p>they let you define adhoc error types from anything that implements Display</p>



<a name="210804215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804215">(Sep 21 2020 at 21:44)</a>:</h4>
<p>I even have a <code>try1!(..)</code> local macro in some functions order to attach some local data to an error before throwing it</p>



<a name="210804225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804225">(Sep 21 2020 at 21:44)</a>:</h4>
<p>rn I haven't added support for #[track_caller] but I have been meaning to</p>



<a name="210804247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804247">(Sep 21 2020 at 21:44)</a>:</h4>
<p>so pretty soon they will implicitly grab the location they were created</p>



<a name="210804264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804264">(Sep 21 2020 at 21:44)</a>:</h4>
<p>makes sense</p>



<a name="210804275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804275">(Sep 21 2020 at 21:45)</a>:</h4>
<p>you should be able to do the same thing currently</p>



<a name="210804304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804304">(Sep 21 2020 at 21:45)</a>:</h4>
<p>if you remove the <code>try1</code> macro and instead use <code>#[track_caller]</code> on your <code>From</code> impl or <code>new</code> or w/e</p>



<a name="210804326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804326">(Sep 21 2020 at 21:45)</a>:</h4>
<p>then you can just use <code>?</code> and it will still grab the location</p>



<a name="210804360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804360">(Sep 21 2020 at 21:45)</a>:</h4>
<p>Well in my case it's not the literal rust stack trace I'm collecting but rather the stack of the language I'm interpreting</p>



<a name="210804417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804417">(Sep 21 2020 at 21:46)</a>:</h4>
<p>ooh interesting</p>



<a name="210804425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804425">(Sep 21 2020 at 21:46)</a>:</h4>
<p>so it's probably more like contextual information from the rust perspective</p>



<a name="210804445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804445">(Sep 21 2020 at 21:46)</a>:</h4>
<p>so at each propagation point you push in a new location?</p>



<a name="210804455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804455">(Sep 21 2020 at 21:46)</a>:</h4>
<p>and its not a <code>std::panic::Location</code></p>



<a name="210804456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804456">(Sep 21 2020 at 21:46)</a>:</h4>
<p>its like</p>



<a name="210804470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804470">(Sep 21 2020 at 21:46)</a>:</h4>
<p>a <code>Span</code> from the source of your language?</p>



<a name="210804475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804475">(Sep 21 2020 at 21:46)</a>:</h4>
<p>yea</p>



<a name="210804478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804478">(Sep 21 2020 at 21:46)</a>:</h4>
<p>gotcha</p>



<a name="210804500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804500">(Sep 21 2020 at 21:47)</a>:</h4>
<p>okay yea, you'll still need your own infra for gathering those</p>



<a name="210804532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804532">(Sep 21 2020 at 21:47)</a>:</h4>
<p>tho <code>eyre</code> might be a good fit for collecting that info</p>



<a name="210804566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804566">(Sep 21 2020 at 21:47)</a>:</h4>
<p>That's fine, I just need the error object to be able to organize the info in some way</p>



<a name="210804579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804579">(Sep 21 2020 at 21:47)</a>:</h4>
<p>and nice printing is nice too</p>



<a name="210804646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804646">(Sep 21 2020 at 21:48)</a>:</h4>
<p>eyre lets you define a custom hook for creating error handlers that can store arbitrary data</p>



<a name="210804652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804652">(Sep 21 2020 at 21:48)</a>:</h4>
<p>heres the one for color-eyre</p>



<a name="210804653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804653">(Sep 21 2020 at 21:48)</a>:</h4>
<p><a href="https://docs.rs/color-eyre/0.5.4/src/color_eyre/lib.rs.html#397-408">https://docs.rs/color-eyre/0.5.4/src/color_eyre/lib.rs.html#397-408</a></p>



<a name="210804667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804667">(Sep 21 2020 at 21:48)</a>:</h4>
<p>for instance if the error object has a thing called a stack trace I could just give it my synthetic stack trace</p>



<a name="210804683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804683">(Sep 21 2020 at 21:48)</a>:</h4>
<p>so instead of storing dyn Display sections for an error report which is what color-eyre is all about you could have a Vec&lt;SpanLocation&gt; for your language</p>



<a name="210804699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804699">(Sep 21 2020 at 21:48)</a>:</h4>
<p>and then define an extension trait for pushing new locations into the report as you propagate it up the stack</p>



<a name="210804729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804729">(Sep 21 2020 at 21:49)</a>:</h4>
<p>like this <a href="https://docs.rs/color-eyre/0.5.4/color_eyre/section/trait.Section.html">https://docs.rs/color-eyre/0.5.4/color_eyre/section/trait.Section.html</a></p>



<a name="210804846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804846">(Sep 21 2020 at 21:50)</a>:</h4>
<p>_is happy to talk all day about error reporting_</p>



<a name="210804852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804852">(Sep 21 2020 at 21:50)</a>:</h4>
<p>lol</p>



<a name="210804945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804945">(Sep 21 2020 at 21:51)</a>:</h4>
<p>Yeah I still need to do my homework on this stuff, I know I've written a ball of hacks and I'm hoping that there is a magical library that solves my problems :)</p>



<a name="210804966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210804966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210804966">(Sep 21 2020 at 21:51)</a>:</h4>
<p>_biased opinion_ that library is eyre</p>



<a name="210805128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210805128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210805128">(Sep 21 2020 at 21:53)</a>:</h4>
<p>heh</p>



<a name="210805135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210805135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210805135">(Sep 21 2020 at 21:53)</a>:</h4>
<p>thanks!</p>



<a name="210805145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210805145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210805145">(Sep 21 2020 at 21:53)</a>:</h4>
<p>my pleasure</p>



<a name="210805166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210805166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210805166">(Sep 21 2020 at 21:53)</a>:</h4>
<p>feel free to msg me directly if you want any feedback / help on error handling and reporting in general</p>



<a name="210810311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810311">(Sep 21 2020 at 22:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="271719">Mario Carneiro</span> <a href="#narrow/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points/near/210802444">said</a>:</p>
<blockquote>
<p>My low tech solution is not particularly well suited to getting nice user level stack traces</p>
</blockquote>
<p>I feel like that's a strong suit of SNAFU. Its primary goal is in adding context to errors. That context often comes from Rust-code-level information, but can easily come from something in the state of the program.</p>
<p>I often say that, when used as intended, SNAFU allows you to have <em>semantic backtraces</em> (as opposed to actual function-level backtraces, which it also supports).</p>



<a name="210810483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810483">(Sep 21 2020 at 22:56)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> I think you missed some later context, the stack traces <span class="user-mention" data-user-id="271719">@Mario Carneiro</span>  is generating are for the programming language they're writing, not for their rust application itself</p>



<a name="210810497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810497">(Sep 21 2020 at 22:57)</a>:</h4>
<p>as part of a language server</p>



<a name="210810531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810531">(Sep 21 2020 at 22:57)</a>:</h4>
<p>I did not miss that. That's explicitly what I'm referring to:</p>
<blockquote>
<p>That context often comes from Rust-code-level information, <strong>but can easily come from something in the state of the program.</strong></p>
</blockquote>



<a name="210810605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810605">(Sep 21 2020 at 22:58)</a>:</h4>
<p>Thus why I'm stating that a semantic stack trace, something that is not the actual stack trace, is relevant.</p>



<a name="210810613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810613">(Sep 21 2020 at 22:58)</a>:</h4>
<p>hmm, I had assumed <span class="user-mention" data-user-id="271719">@Mario Carneiro</span> was building up the stack trace by pushing to a list of spans, rather than wrapping error types to aggregate more ifnromation, but thats just a guess</p>



<a name="210810645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810645">(Sep 21 2020 at 22:59)</a>:</h4>
<p>in any case, dont mind me <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="210810684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810684">(Sep 21 2020 at 23:00)</a>:</h4>
<p>That's more or less true. Some part of the context data can be derived from the calling context, and the rest is obtained by explicitly consulting the program stack (which is a big vector of stack frames used during interpretation)</p>



<a name="210810785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810785">(Sep 21 2020 at 23:00)</a>:</h4>
<p>That's certainly a possibility, but that seems to still fit with what I said. That list of spans is program state. It can be added to an error when the error is constructed / handled.</p>



<a name="210810823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810823">(Sep 21 2020 at 23:00)</a>:</h4>
<p>I'm not really sure what "semantic backtrace" means though</p>



<a name="210810831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810831">(Sep 21 2020 at 23:00)</a>:</h4>
<p>what is semantic about them?</p>



<a name="210810991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210810991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210810991">(Sep 21 2020 at 23:02)</a>:</h4>
<div class="codehilite"><pre><span></span><code>Could not translate the source document &quot;foo.txt&quot;
Because the translation server &quot;bar.example.com&quot; could not be reached
Because the address could not be resolved
Because there is no network connection
</code></pre></div>



<a name="210811018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210811018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210811018">(Sep 21 2020 at 23:03)</a>:</h4>
<p>oh, that's pretty nifty</p>



<a name="210811048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210811048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210811048">(Sep 21 2020 at 23:03)</a>:</h4>
<p>As opposed to </p>
<div class="codehilite"><pre><span></span><code>file1.rs line 123
file1.rs line 345
file2.rs line 555
system.rs line 123304
</code></pre></div>



<a name="210811211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210811211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210811211">(Sep 21 2020 at 23:05)</a>:</h4>
<p>so error objects maintain a list of "reasons" and the <code>context()</code> function appends a new one inside <code>map_err</code>?</p>



<a name="210811482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210811482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210811482">(Sep 21 2020 at 23:09)</a>:</h4>
<p>The <code>Error</code> trait has a <code>source</code> method that can be used to get the causal error. In SNAFU, the <code>context</code> method helps to take a causal error, wrap it into another error, adding context to it at the same time.</p>



<a name="210811530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210811530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210811530">(Sep 21 2020 at 23:09)</a>:</h4>
<p>so <code>fs::read_to_file("config.txt").context(CouldNotReadConfig)?</code> and <code>fs::read_to_file("profile").context(CouldNotReadProfile)?</code></p>



<a name="210811988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210811988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210811988">(Sep 21 2020 at 23:15)</a>:</h4>
<p>Also, while my project may become a library eventually, it is currently rapidly evolving and so the set of reported errors changes frequently. This is the main reason my error object is basically a string. Does snafu encourage a different style of enumerating reasons? Like where is <code>CoudNotReadProfile</code> defined?</p>



<a name="210812084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812084">(Sep 21 2020 at 23:16)</a>:</h4>
<p>In particular, it seems that these error types are almost always one-off things</p>



<a name="210812227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812227">(Sep 21 2020 at 23:18)</a>:</h4>
<p>I don't know what kind of magic would be needed to support defining an enum where the members are ad hoc defined by the various uses of a macro</p>



<a name="210812234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812234">(Sep 21 2020 at 23:18)</a>:</h4>
<p>I would say that <em>is</em> a weak point of SNAFU. All errors are declared in an enum (or multiple enums). A open PR also proposes supporting structs. At a bare minimum, you'd have to type</p>
<div class="codehilite"><pre><span></span><code><span class="cp">#[derive(Debug, Snafu)]</span><span class="w"></span>
<span class="k">enum</span> <span class="nc">Error</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">CouldNotReadConfig</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">source</span>: <span class="nc">io</span>::<span class="n">Error</span><span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="w">    </span><span class="n">CouldNotReadProfile</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">source</span>: <span class="nc">io</span>::<span class="n">Error</span><span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="210812288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812288">(Sep 21 2020 at 23:19)</a>:</h4>
<p>and I assume you have an attribute to give the error message for each variant?</p>



<a name="210812293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812293">(Sep 21 2020 at 23:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="271719">Mario Carneiro</span> <a href="#narrow/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points/near/210812227">said</a>:</p>
<blockquote>
<p>I don't know what kind of magic would be needed to support defining an enum where the members are ad hoc defined by the various uses of a macro</p>
</blockquote>
<p>I'd say basically impossible, but don't let dtolnay hear me or they'll write a crate to do it by the end of the week.</p>



<a name="210812363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812363">(Sep 21 2020 at 23:20)</a>:</h4>
<p>Yes, you can use <code>#[snafu(display("whatever", fields_from_variant))]</code>, but that's optional (the name of the variant is used by default)</p>



<a name="210812372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812372">(Sep 21 2020 at 23:20)</a>:</h4>
<p>gotcha</p>



<a name="210812377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812377">(Sep 21 2020 at 23:20)</a>:</h4>
<p>For your prototyping case, you'd likely leave it off</p>



<a name="210812382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812382">(Sep 21 2020 at 23:20)</a>:</h4>
<p>with snafu you could define something like this right?</p>
<div class="codehilite"><pre><span></span><code><span class="cp">#[derive(Debug, Snafu)]</span><span class="w"></span>
<span class="k">enum</span> <span class="nc">Error</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="cp">#[snafu(display(</span><span class="s">&quot;{}&quot;</span><span class="cp">, msg))]</span><span class="w"></span>
<span class="w">    </span><span class="n">ErrorFrameString</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">source</span>: <span class="nb">Box</span><span class="o">&lt;</span><span class="n">Error</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">msg</span>: <span class="nb">String</span> <span class="p">},</span><span class="w"></span>
<span class="w">    </span><span class="cp">#[snafu(display(</span><span class="s">&quot;{}&quot;</span><span class="cp">, msg))]</span><span class="w"></span>
<span class="w">    </span><span class="n">ErrorFrameStr</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">source</span>: <span class="nb">Box</span><span class="o">&lt;</span><span class="n">Error</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">msg</span>: <span class="kp">&amp;</span><span class="nb">&#39;static</span><span class="w"> </span><span class="kt">str</span><span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="210812438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812438">(Sep 21 2020 at 23:21)</a>:</h4>
<p>can snafu do Option&lt;Box&lt;Error&gt;&gt; as a source?</p>



<a name="210812510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812510">(Sep 21 2020 at 23:22)</a>:</h4>
<p>You could write that, but not quite use it like that, due to coherence issues. You can't implement <code>From&lt;T: std::error::Error&gt; for MyError</code>: <a href="https://stackoverflow.com/q/37347311/155423">How is there a conflicting implementation of <code>From</code> when using a generic type?</a></p>



<a name="210812520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812520">(Sep 21 2020 at 23:22)</a>:</h4>
<p>along those lines, you could also box a dyn display (or just use the Box&lt;Error&gt; itself) and then the macro could support an input style like <code>format!</code> which instead takes the arguments and builds a struct for later display</p>



<a name="210812530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812530">(Sep 21 2020 at 23:22)</a>:</h4>
<p>the Box&lt;Error&gt; there is specifically referring to its own type</p>



<a name="210812535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812535">(Sep 21 2020 at 23:22)</a>:</h4>
<p>not a <code>std::error::Error</code></p>



<a name="210812561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812561">(Sep 21 2020 at 23:23)</a>:</h4>
<p><span class="user-mention" data-user-id="271719">@Mario Carneiro</span> you are pretty close to designing <code>thiserror</code> or <code>anyhow</code>, I believe :-)</p>



<a name="210812565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812565">(Sep 21 2020 at 23:23)</a>:</h4>
<p>lol</p>



<a name="210812575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812575">(Sep 21 2020 at 23:23)</a>:</h4>
<p>yea, but less efficiently</p>



<a name="210812577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812577">(Sep 21 2020 at 23:23)</a>:</h4>
<p>figures</p>



<a name="210812650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812650">(Sep 21 2020 at 23:24)</a>:</h4>
<p>you can similarly do semantic backtraces with eyre/anyhow buy using their <code>wrap_err</code> and <code>context</code> fns respectively</p>



<a name="210812657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812657">(Sep 21 2020 at 23:24)</a>:</h4>
<p>whch does work ontop of <code>Display</code> types</p>



<a name="210812680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812680">(Sep 21 2020 at 23:24)</a>:</h4>
<p>snafu is better at it when you want to be efficient about it since it doesn't have to carry around the strings or allocate most of the time</p>



<a name="210812681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812681">(Sep 21 2020 at 23:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points/near/210812530">said</a>:</p>
<blockquote>
<p>the Box&lt;Error&gt; there is specifically referring to its own type</p>
</blockquote>
<p>Gotcha. Then yes, with a small tweak (untested):</p>
<div class="codehilite"><pre><span></span><code>    #[snafu(display(&quot;{}&quot;, msg))]
    #[snafu(from(Error, Box::new))]
    ErrorFrameString { source: Box&lt;Error&gt;, msg: String },
</code></pre></div>



<a name="210812692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812692">(Sep 21 2020 at 23:24)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> cool</p>



<a name="210812753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812753">(Sep 21 2020 at 23:25)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> do you happen to know if enums inside of enums can end up sharing tag space?</p>



<a name="210812765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812765">(Sep 21 2020 at 23:25)</a>:</h4>
<p>I've always hoped that this was an optimization that exists in rust but I've never heard anyone say it is so I'm guessing no</p>



<a name="210812834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812834">(Sep 21 2020 at 23:26)</a>:</h4>
<p>I believe this is supposed to exist but I think there are also some reasons it can't in many cases</p>



<a name="210812874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812874">(Sep 21 2020 at 23:27)</a>:</h4>
<p>I'll have to think on that, but my gut reaction is "no" because then you couldn't get a reference to one of them cheaply as the tag would be all wrong.</p>



<a name="210812877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812877">(Sep 21 2020 at 23:27)</a>:</h4>
<p>specifically, you can take a reference to the enum member and it has to be a subsequence of bytes in memory of the original enum</p>



<a name="210812891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812891">(Sep 21 2020 at 23:27)</a>:</h4>
<p>what jake said</p>



<a name="210812983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210812983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210812983">(Sep 21 2020 at 23:28)</a>:</h4>
<p>if you overlap them then memcpy can destroy the tag bits when moving things in or out of the enum</p>



<a name="210813011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210813011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210813011">(Sep 21 2020 at 23:29)</a>:</h4>
<p>:((((</p>



<a name="210813053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210813053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210813053">(Sep 21 2020 at 23:29)</a>:</h4>
<p>If you did a whole program analysis you might be able to prove that you never take a reference to the field and thus can shrink the enum. But it's a hard sell</p>



<a name="210813132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210813132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210813132">(Sep 21 2020 at 23:30)</a>:</h4>
<p>I think I will let someone else fight that battle, but cheer them on heartily when they do</p>



<a name="210813150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210813150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210813150">(Sep 21 2020 at 23:31)</a>:</h4>
<p>I think I will do the same :)</p>



<a name="210813259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210813259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210813259">(Sep 21 2020 at 23:32)</a>:</h4>
<p>Actually, maybe a more reasonable option is an attribute on an enum member saying that you opt in to this optimization and therefore you aren't allowed to take a reference to that field</p>



<a name="210813272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210813272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210813272">(Sep 21 2020 at 23:32)</a>:</h4>
<p>oo</p>



<a name="210815714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815714">(Sep 22 2020 at 00:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points/near/210802170">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="271719">Mario Carneiro</span> <a href="#narrow/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points/near/210801943">said</a>:</p>
<blockquote>
<p>Well, I'm aware of eyre and snafu and failure and I think some others, and the names are colorful and tell me nothing about which is better for what</p>
</blockquote>
<p>this doesn't seem to explain how they feel like frameworks</p>
</blockquote>
<p>IMO they feel like frameworks because it's hard to transition away from them</p>



<a name="210815734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815734">(Sep 22 2020 at 00:09)</a>:</h4>
<p>like, I don't think <a href="https://github.com/rust-lang/docs.rs/issues/1014">https://github.com/rust-lang/docs.rs/issues/1014</a> will <em>ever</em> realistically be fixed</p>



<a name="210815816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815816">(Sep 22 2020 at 00:10)</a>:</h4>
<p>once <code>Fail</code> (or any other error type) is in your API it kind of spreads throughout and it's hard to use anything else</p>



<a name="210815842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815842">(Sep 22 2020 at 00:10)</a>:</h4>
<p>hmmm</p>



<a name="210815941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815941">(Sep 22 2020 at 00:12)</a>:</h4>
<p>have you had trouble switching off of <code>snafu</code> / <code>thiserror</code> / other error derives built ontop of the std::error::Error trait?</p>



<a name="210815952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815952">(Sep 22 2020 at 00:12)</a>:</h4>
<p><code>thiserror</code>, yes</p>



<a name="210815954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815954">(Sep 22 2020 at 00:12)</a>:</h4>
<p>I feel like <code>Fail</code> is a special case because it fixed the error trait by being incompatible</p>



<a name="210815973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815973">(Sep 22 2020 at 00:13)</a>:</h4>
<p>I tried to get rid of it for <a href="https://github.com/jyn514/saltwater/">https://github.com/jyn514/saltwater/</a> because of compile times, hit about 350 compile errors, and gave up</p>



<a name="210815975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815975">(Sep 22 2020 at 00:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points/near/210815952">said</a>:</p>
<blockquote>
<p><code>thiserror</code>, yes</p>
</blockquote>
<p>very interested in more details on this</p>



<a name="210815982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815982">(Sep 22 2020 at 00:13)</a>:</h4>
<p>I would expect thiserror to be the absolute easiest to switch away from</p>



<a name="210815988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815988">(Sep 22 2020 at 00:13)</a>:</h4>
<p>the main issue wasn't Display as much as the <code>From</code> impls</p>



<a name="210815994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815994">(Sep 22 2020 at 00:13)</a>:</h4>
<p>I had a <em>lot</em> of <code>#[from]</code></p>



<a name="210815996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210815996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210815996">(Sep 22 2020 at 00:13)</a>:</h4>
<p>given that it is meant to be a drop in replacement for manually writing the trait impls</p>



<a name="210816010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816010">(Sep 22 2020 at 00:14)</a>:</h4>
<p>right, I could have run <code>cargo expand</code> and called it a day but it would have made it fairly unmaintainable</p>



<a name="210816058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816058">(Sep 22 2020 at 00:14)</a>:</h4>
<p>hold on let me find the chat logs, I never got around to opening an issue</p>



<a name="210816076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816076">(Sep 22 2020 at 00:14)</a>:</h4>
<p>I'd have leveraged rust-analyzer which has some actions for generating from impls for enum variants</p>



<a name="210816083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816083">(Sep 22 2020 at 00:14)</a>:</h4>
<p>tho those might be very recent</p>



<a name="210816094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816094">(Sep 22 2020 at 00:14)</a>:</h4>
<p>I only noticed them yesterday, lol</p>



<a name="210816168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816168">(Sep 22 2020 at 00:16)</a>:</h4>
<p>oh it was when I was working on <a href="https://github.com/jyn514/saltwater/pull/448">https://github.com/jyn514/saltwater/pull/448</a></p>



<a name="210816213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816213">(Sep 22 2020 at 00:16)</a>:</h4>
<p>that made me really sad about compile times in general</p>



<a name="210816243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816243">(Sep 22 2020 at 00:16)</a>:</h4>
<p>:(</p>



<a name="210816351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816351">(Sep 22 2020 at 00:18)</a>:</h4>
<p>it looks like the only thing I wrote was this lol</p>
<blockquote>
<p>ok I take it back, I can't get rid of thiserror because of the automatic from implementations<br>
just got 154 of these:</p>
</blockquote>
<div class="codehilite"><pre><span></span><code>error[E0277]: the trait bound `data::error::Error: std::convert::From&lt;data::error::SemanticError&gt;` is not satisfied
   --&gt; src/parse/expr.rs:882:42
    |
882 | ...                   location.error(SemanticError::TypedefInExpressionContext),
    |                                ^^^^^ the trait `std::convert::From&lt;data::error::SemanticError&gt;` is not implemented for `data::error::Error`
</code></pre></div>



<a name="210816373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816373">(Sep 22 2020 at 00:19)</a>:</h4>
<p>I probably <em>could</em> have rewritten it but at that point I wasn't willing to spend that time on the project</p>



<a name="210816403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816403">(Sep 22 2020 at 00:19)</a>:</h4>
<p>gotcha</p>



<a name="210816569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816569">(Sep 22 2020 at 00:22)</a>:</h4>
<p>sorry, didn't mean to take over the conversation haha</p>



<a name="210816578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816578">(Sep 22 2020 at 00:22)</a>:</h4>
<p>its fine</p>



<a name="210816585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816585">(Sep 22 2020 at 00:22)</a>:</h4>
<p>I think your take over fit the thread topic quite nicely actually, lol</p>



<a name="210816681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816681">(Sep 22 2020 at 00:24)</a>:</h4>
<p>second pain point, although this is more a language thing: I really like using <code>fn f() { fallible_op() }</code> instead of <code>fn f() { fallible_op()?; Ok(()) }</code>, but that interferes with error libraries because you have to always add <code>.map(|e| e.into())</code></p>



<a name="210816705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816705">(Sep 22 2020 at 00:25)</a>:</h4>
<p>works great if <code>f</code> and <code>fallible_op</code> have the same return type though</p>



<a name="210816716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816716">(Sep 22 2020 at 00:25)</a>:</h4>
<p>yea</p>



<a name="210816723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816723">(Sep 22 2020 at 00:25)</a>:</h4>
<p>this seems like part of <code>try</code> blocks which is explicitly out of scope for this project group</p>



<a name="210816744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816744">(Sep 22 2020 at 00:26)</a>:</h4>
<p>you could slightly shorten that if <code>.map(|e| e.into())</code> was made into an extension method</p>



<a name="210816745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816745">(Sep 22 2020 at 00:26)</a>:</h4>
<p>aka something like</p>
<div class="codehilite"><pre><span></span><code><span class="k">fn</span> <span class="nf">f</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="nb">Result</span><span class="o">&lt;</span><span class="p">(),</span><span class="w"> </span><span class="n">Error</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">try</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">fallible_op</span><span class="p">()</span><span class="o">?</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="210816802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816802">(Sep 22 2020 at 00:26)</a>:</h4>
<p>well, conceivably it wouldn't need try blocks if <code>Error</code> was the same type as <code>fallible_op</code>, but probably that's not possible</p>



<a name="210816826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816826">(Sep 22 2020 at 00:26)</a>:</h4>
<p>I'm big fan of combining <code>fn() = expr</code> and <code>try</code> blocks to solve this problem personally</p>



<a name="210816838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816838">(Sep 22 2020 at 00:27)</a>:</h4>
<p>that's all nightly stuff though right</p>



<a name="210816839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816839">(Sep 22 2020 at 00:27)</a>:</h4>
<p>but i think im gonna call this one as off topic</p>



<a name="210816851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816851">(Sep 22 2020 at 00:27)</a>:</h4>
<p>try syntax is a lang issue but this is a libs project group</p>



<a name="210816866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816866">(Sep 22 2020 at 00:28)</a>:</h4>
<p><span class="user-mention" data-user-id="271719">@Mario Carneiro</span> <code>fn() = expr</code> isnt a feature at all, I'm not even sure there's been an RFC proposed for it let alone one thats been accepted</p>



<a name="210816912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816912">(Sep 22 2020 at 00:28)</a>:</h4>
<p>afaik its just an idea that I've heard in the past that I quite like</p>



<a name="210816918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816918">(Sep 22 2020 at 00:28)</a>:</h4>
<p>I think its a thing is scala</p>



<a name="210816929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816929">(Sep 22 2020 at 00:28)</a>:</h4>
<p><code>try</code> blocks are a nightly feature tho</p>



<a name="210816938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816938">(Sep 22 2020 at 00:28)</a>:</h4>
<p>I will try to wish it into existence for you</p>



<a name="210816943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210816943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210816943">(Sep 22 2020 at 00:28)</a>:</h4>
<p>loool</p>



<a name="210818831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210818831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210818831">(Sep 22 2020 at 01:01)</a>:</h4>
<p><code>.map_err(Into::into)</code></p>



<a name="210818845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210818845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210818845">(Sep 22 2020 at 01:01)</a>:</h4>
<p>Or the usual-but-surprising <code>Ok(f()?)</code></p>



<a name="210818920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210818920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210818920">(Sep 22 2020 at 01:02)</a>:</h4>
<p>That hits another language annoyance that types can't be coerced to (), so if f returns something you need the extra line</p>



<a name="210818950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210818950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210818950">(Sep 22 2020 at 01:03)</a>:</h4>
<p>this comes up more in matches, often I have to write <code>arm =&gt; f(),</code> into <code>arm =&gt; { f(); }</code> to make it have type <code>()</code></p>



<a name="210818962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210818962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210818962">(Sep 22 2020 at 01:03)</a>:</h4>
<p>Which rustfmt then makes 3 lines</p>



<a name="210819006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210819006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210819006">(Sep 22 2020 at 01:04)</a>:</h4>
<p>But anyway definitely offtopic for this WG</p>



<a name="210819032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210819032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210819032">(Sep 22 2020 at 01:04)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">U</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">u</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">U</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>


<div class="codehilite"><pre><span></span><code><span class="o">=&gt;</span><span class="w"> </span><span class="n">lll</span><span class="p">.</span><span class="n">u</span><span class="p">()</span><span class="w"></span>
</code></pre></div>



<a name="210819037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210819037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210819037">(Sep 22 2020 at 01:04)</a>:</h4>
<p>or <code>drop(lll)</code></p>



<a name="210819043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210819043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210819043">(Sep 22 2020 at 01:04)</a>:</h4>
<p>Oh I hadn't thought of <code>drop</code>, that's nice</p>



<a name="210819052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210819052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210819052">(Sep 22 2020 at 01:05)</a>:</h4>
<p>I'll start using that, thanks :)</p>



<a name="210819772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/210819772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#210819772">(Sep 22 2020 at 01:18)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> <code>fn() -&gt; R = expr</code> has been proposed before, it's not just you. no real rfc or even a draft for it though.</p>



<a name="211364425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/211364425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#211364425">(Sep 26 2020 at 15:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points/near/210812753">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116155">Jake Goulding</span> do you happen to know if enums inside of enums can end up sharing tag space?</p>
</blockquote>
<p>By the way, I just found <a href="https://github.com/rust-lang/unsafe-code-guidelines/issues/69#issuecomment-459445822">a discussion of this</a> on UCG where Rust <em>does</em> this optimization for <code>Option&lt;NonZero&gt;</code> and <code>Option&lt;bool&gt;</code>, and by taking references you can cause weird behavior that people aren't sure how or whether to classify as UB</p>



<a name="212185090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/User%20Stories%3A%20Error%20Handling%20Pain%20Points/near/212185090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jakub Duchniewicz <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/User.20Stories.3A.20Error.20Handling.20Pain.20Points.html#212185090">(Oct 03 2020 at 18:55)</a>:</h4>
<p>Don't know if that was mentioned already, but here is one of 'user stories'<br>
<a href="https://nick.groenen.me/posts/rust-error-handling/">https://nick.groenen.me/posts/rust-error-handling/</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>